home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / freemacs.arc / MINTDEFS.ASM < prev    next >
Assembly Source File  |  1988-03-17  |  1KB  |  60 lines

  1. ;The form data structure:
  2. ;  fb_prim requires that form_length be the first entry.
  3. form    struc
  4. form_length    dw    ?        ;* + [*] -> next *
  5. name_length    dw    ?        ;length in bytes of form name.
  6. hash_link    dw    ?        ;link to next item that hashes to this.
  7. form_pointer    dw    ?        ;number of bytes into the form so far.
  8. data_length    dw    ?        ;number of bytes of data.
  9. form    ends
  10.  
  11. ;note that (size form) + name_length + data_length do not necessarily add
  12. ;  up to form_length.  The data length might be less than the maximum available
  13. ;  to a form.
  14.  
  15. name_offset    equ    (size form)
  16.  
  17. free_space    equ    200
  18.  
  19. NIL    equ    -1
  20.  
  21. sgap    equ    80h
  22.  
  23. mark_overhead    equ    3    ;one mark byte + one pointer (3 bytes total)
  24.  
  25. ;see if di is still below actptr.  If it isn't, we've run out of memory and
  26. ;  must abort.
  27. chk_actptr    macro
  28.     cmp    di,actptr
  29.     jb    $+5
  30.     jmp    nomem
  31.     endm
  32.  
  33. ;see if di+cx is still below actptr.  If it isn't, we've run out of memory and
  34. ;  must abort.
  35. chk_actptr_cnt    macro
  36.     push    di
  37.     add    di,cx
  38.     cmp    di,actptr
  39.     pop    di
  40.     jb    $+5
  41.     jmp    nomem
  42.     endm
  43.  
  44. ;make di point to fbgn and push a copy of it.
  45. ;this macro is used by functions that return a value and don't need their
  46. ;  arguments.  More efficient than di_points_fend.
  47. di_points_fbgn    macro
  48.     mov    di,fbgn
  49.     dec    di
  50.     push    di
  51.     endm
  52.  
  53. ;make di point to fend and push a copy of it.
  54. ;this macro is used by functions that need their arguments.
  55. di_points_fend    macro
  56.     mov    di,fend
  57.     add    di,2
  58.     push    di
  59.     endm
  60.